package com.by.yz.util;

import android.app.Activity;
import android.os.Bundle;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.android.volley.toolbox.NetworkImageView;
import com.by.yz.R;

/**
 * Created by mrs yang on 2017/1/15.
 */
public class ImageSize extends Activity {
    private NetworkImageView image1,image2,image3;

    @Override
    protected void onCreate(Bundle saveInstanceState) {
        super.onCreate(saveInstanceState);
        setContentView(R.layout.activity_current_topic);
        image1 = (NetworkImageView) findViewById(R.id.topicimg1);
        image2 = (NetworkImageView) findViewById(R.id.topicimg2);
        image3 = (NetworkImageView) findViewById(R.id.topicimg3);
        ViewGroup.MarginLayoutParams margin9 = new ViewGroup.MarginLayoutParams(image1.getLayoutParams());
        ViewGroup.MarginLayoutParams margin8 = new ViewGroup.MarginLayoutParams(image2.getLayoutParams());
        ViewGroup.MarginLayoutParams margin7 = new ViewGroup.MarginLayoutParams(image3.getLayoutParams());
        margin9.setMargins(400,10,0,0);//在左边400像素，顶边距为10像素
        margin8.setMargins(400,10,0,0);//在左边400像素，顶边距为10像素
        margin7.setMargins(400,10,0,0);//在左边400像素，顶边距为10像素

        RelativeLayout.LayoutParams layoutParams1=new RelativeLayout.LayoutParams(margin9);
        layoutParams1.height=600;
        layoutParams1.width=800;
        RelativeLayout.LayoutParams layoutParams2=new RelativeLayout.LayoutParams(margin8);
        layoutParams2.height=600;
        layoutParams2.width=800;
        RelativeLayout.LayoutParams layoutParams3=new RelativeLayout.LayoutParams(margin7);
        layoutParams3.height=600;
        layoutParams3.width=800;
        image1.setLayoutParams(layoutParams1);
        image1.setLayoutParams(layoutParams2);
        image1.setLayoutParams(layoutParams3);
    }

}


